package com.bba.cloud.search.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bba.cloud.search.service.ICustomerESService;
import com.bba.manager.common.model.user.VO.customerPageVO;
import com.bba.manager.common.util.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search")
public class CustomerESController {

    @Autowired
    private ICustomerESService customerESService;
    @GetMapping("add")
    public ResponseVO add(){
        customerESService.saveAll();
        return ResponseVO.success();
    }
    @GetMapping("page")
    public ResponseVO page(customerPageVO query){

        IPage page = customerESService.page(query);
        return ResponseVO.success(page);
    }
}
